package com.maigao.persistent;

import com.maigao.entity.jpa.TakeOffRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface TakeOffRecordRepository extends JpaRepository<TakeOffRecord, Long> {
    TakeOffRecord findById(int id);

    List<TakeOffRecord> findByStudentId(Integer studentId);

    List<TakeOffRecord> findByClassRecordId(Integer classRecordId);

    List<TakeOffRecord> findByStudentIdInAndCreateTimeBetween(List<Integer> studentId, LocalDateTime fromDate, LocalDateTime endDate);

    List<TakeOffRecord> findByStudentIdInAndStatus(List<Integer> studentId, Integer status);

    List<TakeOffRecord> findByStatus(Integer status);

    List<TakeOffRecord> findByNoticeStatus(Integer noticeStatus);

    List<TakeOffRecord> findByApproveUserUidAndCreateTimeBetween(Integer approveUserUid, LocalDateTime fromTime, LocalDateTime endTime);
}
